package cliente;

import banco.DaoConexao;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
//import java.util.ArrayList;
//import java.util.List;

/**
 * @author Alexander
 */
public class ClienteControl {

    PreparedStatement conn;
    String cadastraCliente = "INSERT INTO cliente(cnpj,ie,rsocial,logradouro,numero,cep,bairro,telefone,email,pais,uf,fantasia)"
            + "VALUES (?,?,?,?,?,?,?,?,?,?,?,?)";
   
    DaoConexao conn = new DaoConexao();

    public ClienteControl() {
    }

    public void cadastrarCliente(ClienteBean cliente) {
        try {
            conn.setString(1, cliente.getCnpj());
            conn.setString(2, cliente.getIe());
            conn.setString(3, cliente.getRsocial());
            conn.setString(4, cliente.getLogradouro());
            conn.setString(5, cliente.getNumero());
            conn.setString(6, cliente.getCep());
            conn.setString(7, cliente.getBairro());
            conn.setString(8, cliente.getTelefone());
            conn.setString(9, cliente.getEmail());
            conn.setString(10, cliente.getPais());
            conn.setString(11, cliente.getUf());
            conn.setString(12, cliente.getFantasia());
            conn.execute();
            conn.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
